<?php

namespace addons\moneylog;

use app\common\library\Menu;
use think\Addons;

/**
 * 插件
 */
class Moneylog extends Addons
{

    /**
     * 插件安装方法
     * @return bool
     */
    public function install()
    {
        $menu = [
            [
                'name'    => 'money_log',
                'title'   => '资金日志',
                'icon'    => 'fa fa-list-alt',
                'sublist' => [
                    ["name"  => "money_log/index","title" => "查看"],
//                    ["name"  => "money_log/add","title" => "添加"],
//                    ["name"  => "money_log/edit","title" => "编辑"],
                    ["name"  => "money_log/del","title" => "删除"],
//                    ["name"  => "money_log/multi","title" => "批量更新"],
                ]
            ]
        ];
        Menu::create($menu);
        return true;
    }

    /**
     * 插件卸载方法
     * @return bool
     */
    public function uninstall()
    {
        Menu::delete('money_log');
        return true;
    }

    /**
     * 插件启用方法
     * @return bool
     */
    public function enable()
    {
        Menu::enable("money_log");
        return true;
    }

    /**
     * 插件禁用方法
     * @return bool
     */
    public function disable()
    {
        Menu::disable("money_log");
        return true;
    }

}
